<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增消息中心')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-msg-add">
            <div class="form-group">    
                <label class="col-sm-3 control-label">编码：</label>
                <div class="col-sm-8">
                    <input id="cd" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">名称：</label>
                <div class="col-sm-8">
                    <input id="na" class="form-control" type="text" required>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "md/med/dim"
        $("#form-msg-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            var cd = $("#cd").val();
            var na = $("#na").val();
            var tableName=[[${tableName}]];
            var data = {"tableName":tableName,"cd":cd,"na":na};
            $.ajax({
                url: prefix+'/saveDimData',
                type: 'post',
                dataType: 'json',
                contentType: 'application/json;charset=UTF-8',
                data: JSON.stringify(data),
                success: function (result) {
                    if(result.code==0) {
                        $.modal.close();
                    }
                }
            });
        }
    </script>
</body>
</html>